package com.lazycat.backend.controller.shop;


import com.alibaba.fastjson.JSONObject;
import com.lazycat.backend.service.impl.shop.FetchSingleGoodServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
public class FetchSingleGoodController {

    @Autowired
    private FetchSingleGoodServiceImpl fetchSingleGoodService;

    @GetMapping("shop/items/")
    public JSONObject fetch(@RequestParam Map<String, String> map) {
        System.out.println(map);
        Integer goodId = Integer.parseInt(map.get("id"));
        return fetchSingleGoodService.fetch(goodId);
    }

}
